package org.yanfengying.user.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.yanfengying.dto.NoticeContentDTO;
import org.yanfengying.utils.config.RegisterNoticeRabbitmqConfig;

@Component
public class SmsListener {

    /**
     * 监听的时候，只需要指定要监听的队列就可以了
     */
    @RabbitListener(queues = RegisterNoticeRabbitmqConfig.QUEUE_INFORM_SMS)
    public void dealSms(NoticeContentDTO dto, Message message, Channel channel){
        System.out.println(dto);
        // 要根据内容发送短信
    }

}